using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.IO;
using System.Text;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ACM.cmsarea08;
using ACM.cmsarea08.Administration;


namespace ACM.cmsarea08.Administration.Core {
	public partial class PluginsEdit :  System.Web.UI.MasterPage {
		public System.Resources.ResourceManager rm;
		public ACM.cmsarea08.Administration.Controls.MainButton adm_button;
		
		override protected void OnInit(EventArgs e)
		{
			if(Application["RM_ADM"]!=null)
    			rm = (System.Resources.ResourceManager) Application["RM_ADM"];
			string clang = ACM.cmsarea08.mainconfiguration.MainConf.LinguaPredefinita;
				if(ACM.cmsarea08.Users.CurrentUser.Autorizzato)
					clang = ACM.cmsarea08.Users.CurrentUser.PrefLanguage;
			if(System.Threading.Thread.CurrentThread.CurrentCulture.Name!= clang) {
  				
	  		    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(clang);
 			    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(clang);
 		 	}
			base.OnInit(e);	
			InitializeComponent();
		}

		private void InitializeComponent()
		{
			this.Load += new System.EventHandler(this.OnLoad);
			//this.Unload += new System.EventHandler(this.FinePage);
			
			Popola_Title();
			PopolaJavascript_Link();
			PopolaCss_Import();
			
		}
	
		private void OnLoad(object o , EventArgs e) {
			if(!(ACM.cmsarea08.Users.CurrentUser.isRuolo("SysAdm") || 
			    ACM.cmsarea08.Users.CurrentUser.isRuolo("Admin") ||
			    ACM.cmsarea08.Users.CurrentUser.isRuolo("Content Manager")
			   )){
//				Response.Redirect("http://" + Request.ServerVariables["SERVER_NAME"]+"/administration/login.aspx");
			}
			
			
		}
		
		
		
		private void PopolaJavascript_Link () {
		/*
<!--	<link rel="shortcut icon" HREF="/public/prov_img/mondadori_icon.gif"> -->
<script type="text/javascript" src="/administration/template/plugins/mootools-1.js"></script>
<script type="text/javascript" src="/administration/template/js/funzioni.js"></script>
<script type="text/javascript" src="/template/plugins/smoothbox/smoothbox.js"></script>
<script type="text/javascript" src="/template/plugins/tabber/tabber.js"></script>
	*/
		}
		private void PopolaCss_Import() {
			/*
			<style type="text/css">
			<!--
			@import url("/administration/template/css/stile.css");
			@import url("/administration/template/css/form_stile.css");
			@import url("/template/plugins/smoothbox/smoothbox.css");
			-->
			</style>
			*/
		}
		private void Popola_Meta() {
			/*	
		<meta name="sommario"  content="" />
		<meta name="description"  content="" />
		<meta name="keywords" content="" />
		<meta name="robots" content="index, follow" />			
			*/			
		}
		private void Popola_Title() {
			this.Page.Header.Title = mainconfiguration.MainConf.NomePortale + " - Amministrazione";
		}
		
	
	/*
		protected override void Render(HtmlTextWriter output) {
			System.Text.StringBuilder sb = new StringBuilder();
			// Cattura l'output del dgrid base 
			StringWriter writer = new StringWriter();
			HtmlTextWriter buffer = new HtmlTextWriter(writer);

			base.Render(buffer);
			string js = "";
			js+="<script language=\"javascript\" type=\"text/javascript\">";
			js+="window.addEvent('domready', function() {";
			js+=" LockToolbar(); ";
			js+="});";
			js+="</script>";
			string newFile = writer.ToString();
			newFile = newFile.Replace("</body>",js + "</body>");
			
			sb.Append(newFile);
			
			output.Write(sb.ToString());
			
			return;
			
//			string js = "";
//			js+="<script language=\"javascript\" type=\"text/javascript\">";
//			js+="window.addEvent('domready', function() {";
//			js+=" LockToolbar(); ";
//			js+="});";
//			js+="</script>";
////			this.Page.Controls.Add(new LiteralControl(js));			
//			this.Controls.Add(new LiteralControl(js));			
			
			
		}
	*/
	}
	public partial class DummyPluginsEdit :  PluginsEdit{}
}
